

<script type="text/javascript">
	function clearText(inp){if (inp.defaultValue==inp.value){inp.value = "";}}
	
	function drawComparable(id){//alert(id);
		
		var ni =document.getElementById('compdiv');
		var numi =document.getElementById('thevalue');		
		var num = (document.getElementById('thevalue').value -1)+ 2;
		numi.value=num;
		var newdiv = document.createElement('div');
		var divIdName='comp'+num;
		newdiv.setAttribute('id',divIdName);
		newdiv.innerHTML ='<input type="text" class="MinStuff" name="MinStuff"'+
		'value="MinStuff"onclick="clearText(this);" style="display:inline;" />'+
		'<input type="text" class="MaxStuff" name="MaxStuff" value="MaxStuff"onclick="clearText(this);"style="display:inline;"/>';
		 ni.appendChild(newdiv);
	}
	

	function addElement() {
  var ni = document.getElementById('myDiv');
  var numi = document.getElementById('thevalue');
  var num = (document.getElementById('thevalue').value -1)+ 2;
  numi.value = num;
  var newdiv = document.createElement('div');
  var divIdName = 'my'+num+'Div';
  newdiv.setAttribute('id',divIdName);
  
  newdiv.innerHTML = '<input type="text" class="Attribute_Name" name="Attribute_name" value="Attribute name" onclick="clearText(this);" />' +
  '<input type="radio" name="ComparableCheck'+num+'" value="C" onfocus="drawComparable('+num+');"/>Comparable'+
   '<input type="radio" name="ComparableCheck'+num+'" value="D" />Distinct'+
   '<input type="radio" name="ComparableCheck'+num+'" value="N" />Non-Comparable';
	
  ni.appendChild(newdiv);

}</script>
<button onclick= "addElement();" id='addAtribute' > Moar</button>
<br />
<input type="text" class="Attribute_Name" name="Attribute_Name"
	       value="Attribute Name"
	       onclick="clearText(this);"/>
		   
 <input type="radio" name="ComparableCheck0" value="C" onfocus="drawComparable(0);" />Comparable 
 <input type="radio" name="ComparableCheck0" value="D"/>Distinct 
 <input type="radio" name="ComparableCheck0" value="N"/>Non-Comparable
 <input type="hidden" id="thevalue" value='0'/>
<div id="myDiv"> </div>
 
 
 <input type="checkbox" id="checkbox0" style="display:none; visibility:hidden;"/>
 
 <div id="comp" style="display:none; visibility:hidden;" > eimai malakas</div>
 <div id="dist" style="display:none; visibility:hidden;"> kai prezoni</div>
 <div id="non-comp" style="display:none; visibility:hidden;">kai aaaaak</div>
 
 <div id="compdiv"></div>
 <input type="hidden" id="compvalue" value='0'/>

<input type="text" class="MinStuff" name="MinStuff"value="MinStuff"onclick="clearText(this);" style="display:none; visibility:hidden;" />
<input type="text" class="MaxStuff" name="MaxStuff" value="MaxStuff"onclick="clearText(this);" style="display:none; visibility:hidden;" />	
<button name='addAttributesC' id='addAttributesC' value='done' />	   